# import re
# token = 'test_token123213213213213'
# content = "Bearer {$token}"
# text = re.search(r'\{\$(\w+)?\}',content)
# r = content.replace(text.group(),token)
# print(r)
#
# # print(text)
# # print(text.group())
# # print(text.groups())
# # print(text.group(1))


import requests
from urllib import parse

url = 'https://test-gateway.huodongzhongguo.com/platform/api/activityManagement/activity/listActivity'
headers = {'Content-Type': 'application/x-www-form-urlencoded', 'authorization': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJDTElFTlRfVEFHIjoiUExUIiwiUEFSRU5UIjoxNCwiVElNRVNUQU1QIjoyNTEwODMzNDU5Njk4Mzc1OSwiVVNFUk5BTUUiOiJsaWppYW4wMiIsIlVVSUQiOjMyMiwianRpIjoiOTgwZGUyNWJlYTUzZTQwNDExNjcyMWMwYTNkMTJiMjYifQ.1YNLK5hlxNF6L4psD4azXzdGUO73XRLN7nK1YHXysps'}
data = {'pageSize': '6', 'pageNum': '1'}


res = requests.post(url=url,headers=headers,data=data).json()
for item in res['data']['data']:
    requests.get(url='https://test-gateway.huodongzhongguo.com/platform/api/activityManagement/activity/noMoreActivity/'+str(item['id']),headers={'authorization': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJDTElFTlRfVEFHIjoiUExUIiwiUEFSRU5UIjoxNCwiVElNRVNUQU1QIjoyMDk4NzE3NTIyMTM0MjUwOCwiVVNFUk5BTUUiOiJsaWppYW4wMiIsIlVVSUQiOjMyMiwianRpIjoiZDA1ZTQ1ZmU1YzU5NWVlOWJjMTM2NTEwYTk2M2U2MWEifQ.xWsjiWw-7-SxuQqmH6HJ1GNUXQFnCm09y0xDEoVZ038'})
